package com.aruba.daggerapplication.di

import com.aruba.daggerapplication.MainActivity
import com.aruba.daggerapplication.ScopeActivity
import com.aruba.daggerapplication.di.module.NetworkModule
import com.aruba.daggerapplication.di.module.SubcomponentModule
import com.aruba.daggerapplication.di.scope.MyScope
import dagger.Component
import dagger.Module
import javax.inject.Singleton

/**
 * 注入中间件
 * Created by aruba on 2021/12/4.
 */
@MyScope
@Component(modules = [NetworkModule::class, SubcomponentModule::class])
interface ApplicationComponent {
    /**
     * 表示注入到 MainActivity中
     */
    fun inject(activity: MainActivity)

    /**
     * 表示注入到 ScopeActivity中
     */
    fun inject(activity: ScopeActivity)

    /**
     * 提供获取创建子组件的Factory
     */
    fun subComponent(): SubComponent.Factory
}